<style>
body, html {
    margin: 0;
}
#a, #b {
    position: absolute;
    width: 100px;
    height: 100px;
}
#a {
    z-index: 2;
    background: red;
}
#b {
    top: 50px;
    left: 50px;
    background: green;
}
</style>
<div id=a></div>
<div id=b></div>

